package aaaWAR;

public class Solution {

	public static void main(String[] args) {
		
			Solution solution = new Solution();
			int[] nums = new int[]{1,3,5,7,8};
		    int target = 15;
			int[] sum = solution.twoSum(nums, target);
			for (int i : sum) {
				System.out.println(i);
			}
			
	}

    public int[] twoSum(int[] nums, int target) {

    	int[] num = new int[2];
        for(int i = 0; i < nums.length; i++){
            if(nums[i] + nums[i+1] == target){
                
                num[0] = i;
                num[1] = i+1;
                return num;
            }
        }
        return num;
    }
}

